class PutatayFbaLPN {
  int type;
  int smallType; // 0非小件 1小件
  List<PutatayLPN> skuList;

  PutatayFbaLPN({
    this.type,
    this.smallType,
    this.skuList,
  });

  factory PutatayFbaLPN.fromJson(Map<String, dynamic> json) {
    return PutatayFbaLPN(
      type: json["type"],
      smallType: json["smallType"],
      skuList: json['skuList'] == null ? null : (new List<dynamic>.from(json['skuList']).map((userJson) => PutatayLPN.fromJson(userJson)).toList()),
    );
  }
//

}

class PutatayLPN {
  String sku;
  int quantity;
  String wholeCode;

  PutatayLPN({
    this.sku,
    this.quantity,
    this.wholeCode,
  });

  factory PutatayLPN.fromJson(Map<String, dynamic> json) {
    return PutatayLPN(
      sku: json["sku"],
      quantity: json["quantity"],
      wholeCode: json["wholeCode"],
    );
  }
}

class ReturnPutawayLocationQr {
  String inbound_lpn;
  String location;
  String processType;
  String category = "LPN";

  Map<String, dynamic> toJson() {
    return {
      "inbound_lpn": this.inbound_lpn,
      "location": this.location,
      "processType": this.processType,
      "category": this.category,
    };
  }
}

class Bounce {
  String backend; //匹配来源：b2c、b2b
  String createdBy; //创建人
  int createdById; //创建人id
  String createdDatetime; //创建时间
  List<String> damagedPhotos; //破损照片
  String fboId; //FBO唯一ID，使用此来提交入仓明细
  int id; //
  int locationId; //上架库位
  String lpn; //lpn
  int matched; //是否需要创建退件入仓单 1：匹配了退件入仓单 2：逆向物流：需要来创建退件入仓单 3：未匹配（需匹配入仓单）
  String orderId; //匹配来源订单id
  String overallPhoto; //整体照片
  int processStatus; //处理状态 0：未处理 1处理完成
  String processTime; //处理时间
  String processType; //处理意见，D:弃置 P:上架 并可以过滤
  String processUser; //处理人
  String putawayTime; //上架时间
  String putawayUser; //上架操作人
  String sku; //sku
  int skuNum; //sku数量
  String skuPhoto; //SKU照片
  String trackingCode; //运单号
  String trkPhoto; //TRK照片
  String updatedBy; //更新人
  int updatedById; //更新人id
  String updatedDatetime; //更新时间
  String warehouseCode; //仓库编码
  List<String> barcodes; //sku的barcode集合
  bool regular; //true：正常、false：异常
  String repeat;

  Bounce({
    this.backend,
    this.createdBy,
    this.createdById,
    this.createdDatetime,
    this.damagedPhotos,
    this.fboId,
    this.id,
    this.locationId,
    this.lpn,
    this.matched,
    this.orderId,
    this.overallPhoto,
    this.processStatus,
    this.processTime,
    this.processType,
    this.processUser,
    this.putawayTime,
    this.putawayUser,
    this.sku,
    this.skuNum,
    this.skuPhoto,
    this.trackingCode,
    this.trkPhoto,
    this.updatedBy,
    this.updatedById,
    this.updatedDatetime,
    this.warehouseCode,
    this.barcodes,
    this.regular,
    this.repeat,
  });

  factory Bounce.fromJson(Map<String, dynamic> json) {
    return Bounce(
      backend: json["backend"],
      createdBy: json["createdBy"],
      createdById: json["createdById"],
      createdDatetime: json["createdDatetime"],
      damagedPhotos: json['damagedPhotos'] == null ? null : new List<String>.from(json['damagedPhotos']) as List<String>,
      fboId: json["fboId"],
      id: json["id"],
      locationId: json["locationId"],
      lpn: json["lpn"],
      matched: json["matched"],
      orderId: json["orderId"],
      overallPhoto: json["overallPhoto"],
      processStatus: json["processStatus"],
      processTime: json["processTime"],
      processType: json["processType"],
      processUser: json["processUser"],
      putawayTime: json["putawayTime"],
      putawayUser: json["putawayUser"],
      sku: json["sku"],
      skuNum: json["skuNum"],
      skuPhoto: json["skuPhoto"],
      trackingCode: json["trackingCode"],
      trkPhoto: json["trkPhoto"],
      updatedBy: json["updatedBy"],
      updatedById: json["updatedById"],
      updatedDatetime: json["updatedDatetime"],
      warehouseCode: json["warehouseCode"],
      barcodes: json['barcodes'] == null ? null : new List<String>.from(json['barcodes']) as List<String>,
      regular: json["regular"],
      repeat: json["repeat"],
    );
  }

  Map<String, dynamic> toJson() {
    return {
      "backend": this.backend,
      "createdBy": this.createdBy,
      "createdById": this.createdById,
      "createdDatetime": this.createdDatetime,
      "damagedPhotos": this.damagedPhotos,
      "fboId": this.fboId,
      "id": this.id,
      "locationId": this.locationId,
      "lpn": this.lpn,
      "matched": this.matched,
      "orderId": this.orderId,
      "overallPhoto": this.overallPhoto,
      "processStatus": this.processStatus,
      "processTime": this.processTime,
      "processType": this.processType,
      "processUser": this.processUser,
      "putawayTime": this.putawayTime,
      "putawayUser": this.putawayUser,
      "sku": this.sku,
      "skuNum": this.skuNum,
      "skuPhoto": this.skuPhoto,
      "trackingCode": this.trackingCode,
      "trkPhoto": this.trkPhoto,
      "updatedBy": this.updatedBy,
      "updatedById": this.updatedById,
      "updatedDatetime": this.updatedDatetime,
      "warehouseCode": this.warehouseCode,
      "barcodes": this.barcodes,
      "regular": this.regular,
      "repeat": this.repeat,
    };
  }
}

class FinalProcess {
  List<ProcessingDTO> processing;
  List<ProcessingDTO> complete;

  FinalProcess({
    this.processing,
    this.complete,
  });

  factory FinalProcess.fromJson(Map<String, dynamic> json) {
    return FinalProcess(
      processing: json['processing'] == null ? null : (new List<dynamic>.from(json['processing']).map((userJson) => ProcessingDTO.fromJson(userJson)).toList()),
      complete: json['complete'] == null ? null : (new List<dynamic>.from(json['complete']).map((userJson) => ProcessingDTO.fromJson(userJson)).toList()),
    );
  }
//

}

class ProcessingDTO {
  String batchNo;
  String lpn;
  Object pcs;
  Object pending;

  ProcessingDTO({
    this.batchNo,
    this.lpn,
    this.pcs,
    this.pending,
  });

  factory ProcessingDTO.fromJson(Map<String, dynamic> json) {
    return ProcessingDTO(
      batchNo: json["batchNo"],
      lpn: json["lpn"],
      pcs: json["pcs"],
      pending: json["pending"],
    );
  }
}

class FinalProcessDetail {
  String lpn; //lpn
  int pcs; //待处理总数量
  int pending; //待打单数量

  FinalProcessDetail({
    this.lpn,
    this.pcs,
    this.pending,
  });

  factory FinalProcessDetail.fromJson(Map<String, dynamic> json) {
    return FinalProcessDetail(
      lpn: json["lpn"],
      pcs: json["pcs"],
      pending: json["pending"],
    );
  }
}

class FinalProcessLpn {
  int id;
  String type; //类型  D：指定销毁 D2：系统销毁 P：上架 R：返还客户  RP：重新拍照
  String trackingCode;

  FinalProcessLpn({
    this.id,
    this.type,
    this.trackingCode,
  });

  factory FinalProcessLpn.fromJson(Map<String, dynamic> json) {
    return FinalProcessLpn(
      id: json["id"],
      type: json["type"],
      trackingCode: json["trackingCode"],
    );
  }
}

class FinalProcessTrk {
  int id;
  String type; //类型  D：指定销毁 D2：系统销毁 P：上架 R：返还客户  RP：重新拍照
  String sku; //sku
  String newSku; //newSku
  String account; //账户
  String notes; //备注
  String batchNo; //批次号
  String ibLpn; //inbound lpn
  int quantity;
  String trackingCode; //trackingCode
  String openLassSku; //
  int accountId; //
  int retape; //是否加固 1加固 0不加固
  List<String> barcodes; //

  FinalProcessTrk({
    this.id,
    this.type,
    this.sku,
    this.newSku,
    this.account,
    this.notes,
    this.batchNo,
    this.ibLpn,
    this.quantity,
    this.trackingCode,
    this.openLassSku,
    this.accountId,
    this.retape,
    this.barcodes,
  });

  factory FinalProcessTrk.fromJson(Map<String, dynamic> json) {
    return FinalProcessTrk(
      id: json["id"],
      type: json["type"],
      sku: json["sku"],
      newSku: json["newSku"],
      account: json["account"],
      notes: json["notes"],
      batchNo: json["batchNo"],
      ibLpn: json["ibLpn"],
      quantity: json["quantity"],
      trackingCode: json["trackingCode"],
      openLassSku: json["openLassSku"],
      accountId: json["accountId"],
      retape: json["retape"],
      barcodes: json['barcodes'] == null ? null : new List<String>.from(json['barcodes']) as List<String>,
    );
  }
}

class FinalProcessQr {
  String batchNo; //批次号
  String oldIbLpn; //原iblpn
  String newIbLpn; //新iblpn
  String newObLpn; //新oblpn
  String returnBatchDetailId; //二次处理详情id
  String trackingCode; //trk#
  String type; //类型  D：指定销毁 D2：系统销毁 P：上架 R：返还客户  RP：重新拍照
  String sku; //sku
  String newSku; //sku
  int quantity; //数量
  String account; //账户
  String label; //
  String openLassSku; //
  String overallPhoto; //
  String trkPhoto; //
  String skuPhoto; //
  String retapedPhoto; //加固图片
  int accountId; //
  int retape;

  Map<String, dynamic> toJson() {
    return {
      "batchNo": this.batchNo,
      "oldIbLpn": this.oldIbLpn,
      "newIbLpn": this.newIbLpn,
      "newObLpn": this.newObLpn,
      "returnBatchDetailId": this.returnBatchDetailId,
      "trackingCode": this.trackingCode,
      "type": this.type,
      "sku": this.sku,
      "newSku": this.newSku,
      "quantity": this.quantity,
      "account": this.account,
      "label": this.label,
      "openLassSku": this.openLassSku,
      "overallPhoto": this.overallPhoto,
      "trkPhoto": this.trkPhoto,
      "skuPhoto": this.skuPhoto,
      "retapedPhoto": this.retapedPhoto,
      "accountId": this.accountId,
      "retape": this.retape,
    };
  } //是否加固 1加固 0不加固

}

class FinalProcessReturn {
  List<FinalProcessLpn> trackingCode;
  List<String> lpns;

  FinalProcessReturn({
    this.trackingCode,
    this.lpns,
  });

  factory FinalProcessReturn.fromJson(Map<String, dynamic> json) {
    return FinalProcessReturn(
      trackingCode: json['trackingCode'] == null ? null : (new List<dynamic>.from(json['trackingCode']).map((userJson) => FinalProcessLpn.fromJson(userJson)).toList()),
      lpns: json['lpns'] == null ? null : new List<String>.from(json['lpns']) as List<String>,
    );
  }

}

class FinalProcessCheckBatch  {
  List<String> lpns = new List();
  FinalProcessTrk returnCheckTrkRespVo;

  FinalProcessCheckBatch({
    this.lpns,
    this.returnCheckTrkRespVo,
  });

  factory FinalProcessCheckBatch.fromJson(Map<String, dynamic> json) {
    return FinalProcessCheckBatch(
      lpns: json['lpns'] == null ? null : new List<String>.from(json['lpns']) as List<String>,
      returnCheckTrkRespVo: FinalProcessTrk.fromJson(json["returnCheckTrkRespVo"]),
    );
  }

}

class NewPreprocess {
  String trk;
  String sku;
  int qty;

  NewPreprocess({
    this.trk,
    this.sku,
    this.qty,
  });

  factory NewPreprocess.fromJson(Map<String, dynamic> json) {
    return NewPreprocess(
      trk: json["trk"],
      sku: json["sku"],
      qty: json["qty"],
    );
  }
}

class NoTrkOrder {
  String type;//类型
  String base64;//pdf

  NoTrkOrder({
    this.type,
    this.base64,
  });

  factory NoTrkOrder.fromJson(Map<String, dynamic> json) {
    return NoTrkOrder(
      type: json["type"],
      base64: json["base64"],
    );
  }

}

class PreprocessReasonQr {
  int id;
  String lpn;
  String tracking_number;
  String sku_barcode;
  int quantity;
  String status;//good,slightly_damaged,damaged

  String overall;//正面图片
  String damaged;//损坏图片
  String trkPhoto;    //面单图片
  String skuPhoto;//sku图片

  PreprocessReasonQr({
    this.id,
    this.lpn,
    this.tracking_number,
    this.sku_barcode,
    this.quantity,
    this.status,
    this.overall,
    this.damaged,
    this.trkPhoto,
    this.skuPhoto,
  });

  factory PreprocessReasonQr.fromJson(Map<String, dynamic> json) {
    return PreprocessReasonQr(
      id: json["id"],
      lpn: json["lpn"],
      tracking_number: json["tracking_number"],
      sku_barcode: json["sku_barcode"],
      quantity: json["quantity"],
      status: json["status"],
      overall: json["overall"],
      damaged: json["damaged"],
      trkPhoto: json["trkPhoto"],
      skuPhoto: json["skuPhoto"],
    );
  }

  Map<String, dynamic> toJson() {
    return {
      "id": this.id,
      "lpn": this.lpn,
      "tracking_number": this.tracking_number,
      "sku_barcode": this.sku_barcode,
      "quantity": this.quantity,
      "status": this.status,
      "overall": this.overall,
      "damaged": this.damaged,
      "trkPhoto": this.trkPhoto,
      "skuPhoto": this.skuPhoto,
    };
  }
}

class Preprocess   {
  String location;

  Preprocess({
    this.location,
  });

  factory Preprocess.fromJson(Map<String, dynamic> json) {
    return Preprocess(
      location: json["location"],
    );
  }

}
